<!-- Load TinyMCE -->
<script type="text/javascript" src="media/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="media/tiny_mce/config.js"></script>
<script type="text/javascript" src="media/js/jquery.validate.min.js"></script>
<script type="text/javascript">
tiny('detail');
$(function(){
	$("#frmMain").validate({
		rules: 
		{
			"title": 
			{ 
				required: true
			}
		},
		messages:
		{
			"title": 
			{ 
				required: "กรุณากรอกหัวข้อค่ะ"
			}
		}
	});	
	
	var formId = $("#form-id").val() - 1;
	$("#horri_menu ul li:eq("+formId+")").addClass("active");
})
</script>

<h1>ตำบลต้นแบบ</h1>
<?php include "_menu.php";?>

<form id="frmMain" action="district_infos/admin/district_infos/save/" method="post" enctype="multipart/form-data" style="margin: 20px 0 0 0;" >
	
<table class="form">
	<tr>
		<th>หัวข้อ :</th>
		<td>
			<input type="text" name="title" value="<?php echo $district_info->title?>" class="full" />
		</td>
	</tr>
	<tr>
		<th>รายละเอียด :</th>
		<td>
			<div><textarea name="detail" class="full tinymce"><?php echo $district_info->detail?></textarea></div>
		</td>
	</tr>
	<tr>
		<th>ไฟล์แนบ :</th>
		<td><input type="text" name="file" value="<?php echo $district_info->file?>"/><input type="button" name="browse" value="เลือกไฟล์" onclick="browser($(this).prev(),'info')" /></td>
	</tr>
	<tr>
		<th></th>
		<td>
			<input id="form-id" type="hidden" name="id" value="<?php echo $this->uri->segment(5)?>">
			<?php if(permission('district_infos', 'update')):?>
			<input type="submit" value="บันทึก" /><?php echo form_back() ?>
			<?php endif;?>
		</td>
	</tr>
</table>
<?php echo form_referer() ?>
</form>
